#include "Lighting.glsl";
// #if defined(GL_FRAGMENT_PRECISION_HIGH)// 原来的写法会被我们自己的解析流程处理，而我们的解析是不认内置宏的，导致被删掉，所以改成 if defined 了
//     precision highp float;
// #else
//     precision mediump float;
// #endif
attribute vec4 a_Position;
varying vec2 v_Texcoord0;

#ifdef GPU_INSTANCE
    attribute mat4 a_MvpMatrix;
#endif

#ifdef MVP3D
    uniform mat4 u_MvpMatrix;
#endif

#ifdef WORLDMAT
    uniform mat4 mmat;
#endif

void main() {
    vec4 pos = vec4(a_Position.xy, 0., 1.);
#ifdef WORLDMAT
    pos = mmat * pos;
#endif
    //gl_Position = vec4(a_Position.xy, 0.0, 1.0);
#ifdef GPU_INSTANCE
    gl_Position = a_MvpMatrix * pos;
#elif defined(MVP3D)
    gl_Position = u_MvpMatrix * pos;
#else 
    gl_Position = pos;
#endif
    v_Texcoord0 = a_Position.zw;
    gl_Position = remapGLPositionZ(gl_Position);
}